<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
	<title>iDEZ JET</title>
	<link rel="stylesheet" type="text/css"
		href="/idezJetJSF2/css/style.css" />
</h:head>

<body id="body">

	<p:layout fullPage="true">
		<p:layoutUnit position="top" height="150" resizable="false"
			closable="false" collapsible="false" id="headerBg">
			<ui:insert name="header">
				<ui:include src="header.xhtml" />
			</ui:insert>
		</p:layoutUnit>

		<p:layoutUnit position="bottom" height="75" resizable="false"
			closable="false" collapsible="false" style="text-align: center;" >
			<ui:insert name="footer">
				<ui:include src="footer.xhtml" />
			</ui:insert>
		</p:layoutUnit>

		<p:layoutUnit position="left" width="200" 
			resizable="false" closable="false" collapsible="false">
			<h:form id="loginForm">
				<p:panel header="Login" rendered="#{loginBean.renderedLogin}">
					<h:panelGrid columns="1">
						<h:outputLabel id="labelEmail" value="Email:" for="inputEmail" />
						<p:inputText id="inputEmail" value="#{loginBean.usuario.email}" />
						<p:message for="inputEmail" />

						<h:outputLabel id="labelSenha" value="Senha:" for="inputSenha" />
						<p:password id="inputSenha" value="#{loginBean.usuario.senha}" feedback="false" />
						<p:message for="inputSenha" />

						<p:commandButton id="buttonLogin" value="Autenticar"
							action="#{loginBean.autenticar}" ajax="false" />
					</h:panelGrid>
				</p:panel>
				<p:panel header="Bem-Vindo #{loginBean.usuario.nome}"
					rendered="#{!loginBean.renderedLogin}">
					<p:menu type="tiered" position="">
						<p:menuitem value="Logout" action="#{loginBean.logout}" ajax="false" />
					</p:menu>
				</p:panel>
			</h:form>
			<ui:insert name="menu">
				<ui:include src="menu.xhtml" />
			</ui:insert>
		</p:layoutUnit>

		<p:layoutUnit position="center" resizable="false" closable="false"
			collapsible="false">
			<h:form>
				<h:commandButton value="Seu Carrinho" action="#{carrinhoBean.prepararCarrinho}" style="float:right;"  />
			</h:form>
			<p:divider  />
			<p:messages globalOnly="true" />
			<ui:insert name="content" />
		</p:layoutUnit>
	</p:layout>

</body>

</html>
